# !/usr/bin/env python
# -*- coding: utf-8 -*-
# ------------------------------
'''
str操作‘upper’变大写        ‘lower’变小写   ‘title’所有单词首字大写
'capitalize'首字大写        'swapcase'大小写转化
'startswitch'字符串开始的标志   ‘endswitch’字符串结束的标志
'''
data = "actlove"
data1 = "ashoih"
data2 = "asdiheuhjkasd"
print(data.title())
'''
ActLove
'''
print(data1.capitalize())
'''
Ashoih
'''
print(data1.swapcase())
'''
ASHOIH
'''
print(data2.count("asd"))
'''
2     输出有多少次我选中的字符串出现再data2中  
 .count("要测试的字符串或字符"，"要开始的字符的下标"， “要结束的字符的下标”)
'''
print(data2.count("as", 2, 9))
'''
0
'''
print(data2.startswith('a', 0))
'''
True   返回布尔值startswith(要判断字符串的前戳, 正着从哪里开始遍历（下标）)
'''
print(data2.endswith("d", -1))
'''
True   返回布尔值endswith(要判断字符串的后戳, 倒着从哪里开始遍历（下标）)
'''